//
//  PartyCleanCurtureController.m
//  UESTCPioneer
//
//  Created by Apple on 14-9-26.
//  Copyright (c) 2014年 Sway. All rights reserved.
//

#import "PartyCleanCurtureController.h"
#import "UPTableView.h"
#import "UPTitleCell.h"
#import "UPMainInfoCell.h"
#import "UPFooterCell.h"
#import "constant.h"
#import "LeveyTabBarController.h"
#import "PioneerNewsEntity.h"
#import "PartyCleanCutureEntity.h"

@interface PartyCleanCurtureController ()

@property (nonatomic,strong) NSMutableArray * collegeArray;

@end

@implementation PartyCleanCurtureController

- (void)viewDidLoad
{
    [super viewDidLoad];
//    [self.leveyTabBarController.navigationItem setTitle:@"廉政文化"];
    self.title = @"廉政文化";
    UnreadKey=kUnreadPioneerKey;
    self.fromSourceEnable = YES;
    self.tableView.delegate = self;
    self.tableView.dataSource = self;
    [self hideTopView];
    tableViewTopConstraint.constant = 0;

    //请求初始化
    entityName=@"PartyCleanCutureEntity";
    entityMapping=[Mapping PartyCleanCutureEntityMapping];
    requestData=@{@"type":@"getLianzheng",@"page":@"1",@"userId":[constant getUserId],@"userName":[constant getUserName]};
}

-(void)viewWillAppear:(BOOL)animated{
    [super viewWillAppear:animated];
    UITapGestureRecognizer *tapGesture = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(ScreenTouch)];
    [self.tableView addGestureRecognizer:tapGesture];
}

#pragma  mark  触摸事件
-(BOOL)ScreenTouch{
    
    if(dropDown == nil) {
        return NO;
    }
    else {
        [dropDown hideDropDown:dropbtn];
        [self rel];
        return YES;
    }
}

/**/
//每个分区的行数
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    return 2;
}

//表的分区数
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
    return [tableViewEntitiesArray count];
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    UITableViewCell*cell=[super tableView:tableView cellForRowAtIndexPath:indexPath];
    
    /*修改*/
//    PartyCleanCutureEntity *entity = tableViewEntitiesArray[indexPath.section];
//    self.source = entity.comeFrom;
    if (indexPath.row == 0) {
        UPTitleCell *cell1 = (UPTitleCell*)cell;
        return cell1;
    } else {
        UPMainInfoCell*cell2=(UPMainInfoCell*)cell;
        return cell2;
    }
}

//修改行高度的位置
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
    return [super tableView:tableView heightForRowAtIndexPath:indexPath];
}

- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{
    return 5;
}
- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section{
    // indexPath.section,根据分组进行更精确的配置
    return 5;
}

@end
